package com.fms.gui.util.updateSet;

import junit.framework.TestCase;

import org.jmock.Expectations;
import org.jmock.Mockery;

import com.fms.gui.util.IUpdatable;

public class UpdateSetTest extends TestCase
{
	public void testPropogateUpdate()
	{
		Mockery mock = new Mockery();
		
		final IUpdatable a = mock.mock(IUpdatable.class, "A");
		final IUpdatable b = mock.mock(IUpdatable.class, "B");
		final IUpdatable c = mock.mock(IUpdatable.class, "C");
		
		
		UpdateSet set = new UpdateSet();
		
		set.add(a);
		set.add(b);
		set.add(c);
		
		
		mock.checking(new Expectations() {{
			oneOf(a).update();
			oneOf(b).update();
			oneOf(c).update();
		}});
		
		set.update();
		
		mock.assertIsSatisfied();
		
		
	}
	
	


}
